import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.administrator.myapplication.R;

/**
 * Created by Administrator on 2019/3/18.
 */

public class MyActivity extends AppCompatActivity {
    //申明成员变量
    Button mBtnNext;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.myLayout);
        setContentView(R.layout.mylayout);
        mBtnNext = findViewById(R.id.btn_next);
        mBtnNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MyActivity.this,MyActivity2.class);
                startActivity(intent);
            }
        });
    }
}
